Skip to content

Remove Use of /genai Route#405

Merged
johnwalz97 merged 3 commits intomainfrom
john6797/sc-11566/remove-genai-route
Aug 5, 2025
Merged

Remove Use of /genai Route#405
johnwalz97 merged 3 commits intomainfrom
john6797/sc-11566/remove-genai-route

Conversation

@johnwalz97
Copy link
Contributor

@johnwalz97 johnwalz97 commented Aug 4, 2025

Pull Request Description

We no longer need to publicly access the LLM proxy hosted in the ValidMind platform.

https://app.shortcut.com/validmind/story/11566/remove-genai-route

What and why?

How to test

What needs special review?

Dependencies, breaking changes, and deployment notes

Release notes

Checklist

  • What and why
  • Screenshots or videos (Frontend)
  • How to test
  • What needs special review
  • Dependencies, breaking changes, and deployment notes
  • Labels applied
  • PR linked to Shortcut
  • Unit tests added (Backend)
  • Tested locally
  • Documentation updated (if required)
  • Environment variable additions/changes documented (if required)

@johnwalz97 johnwalz97 added internal Not to be externalized in the release notes chore Chore tasks that aren't bugs or new features labels Aug 4, 2025
@nibalizer nibalizer requested a review from eggshell August 4, 2025 16:14
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

PR Summary

This PR simplifies the LLM client initialization process by removing the legacy logic used to retrieve an API key from a dynamically constructed ValidMind API endpoint. Specifically, the changes include:

  • Eliminating the try-except block in the client setup within the utils module that previously attempted to retrieve an API key and dynamically set the target model and API URL.
  • Directly raising a ValueError when the required keys (OPENAI_API_KEY, AZURE_OPENAI_KEY) are not set, removing any fallback behavior.
  • Removing the unused function get_ai_key from the api_client module to avoid circular import issues and simplify the overall codebase.

These modifications lead to a cleaner, more maintainable codebase by removing unnecessary complexity and avoiding potential issues with circular imports and dynamic URL handling.

Test Suggestions

  • Verify that get_client_and_model raises the appropriate ValueError when the environment is missing the required API keys.
  • Test that when valid API keys are set, the correct client (AzureOpenAI or OpenAI) is initialized.
  • Ensure that no parts of the codebase reference the removed get_ai_key function, confirming its complete removal.
  • Perform integration tests to ensure that the simplified client initialization does not break downstream functionality.

@johnwalz97 johnwalz97 merged commit de623d4 into main Aug 5, 2025
7 checks passed
@johnwalz97 johnwalz97 deleted the john6797/sc-11566/remove-genai-route branch August 5, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore tasks that aren't bugs or new features internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants